package com.jiazhong.IO流.打印流;

import java.io.*;
import java.util.Scanner;

public class PrintWriterDemo {
    public static void main(String[] args) throws IOException {
//        Scanner scanner = new Scanner(System.in);
        //创建一个从键盘输入的字符输入流System.in(键盘输入)
        BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));
        //控制输出
        PrintWriter printWriter = new PrintWriter(System.out);
        while (true){
            System.out.println("请输入要输入的数据:");
            String str = bufferedReader.readLine();
            if (str.equals("exit")){
                break;
            }
            printWriter.write(str);
            printWriter.flush();
        }
        printWriter.close();

        /*PrintWriter printWriter = new PrintWriter(System.out);
        printWriter.println("你滴");
        printWriter.print("死啦死啦滴");
        printWriter.write("扣你吉瓦");
        printWriter.write("欧尼酱\n");
        printWriter.write("哦多桑");
        printWriter.flush();
        printWriter.close();*/
    }
}
